function scrollList(w, s, t, b, n, h) {
    n = n || 0;
    h = h || "click";
    if (w === undefined) {
        return
    }
    var l = w.width();
    var k = 0;
    var f = w.find("li");
    var q = f.size();
    var e = f.eq(0);
    var a = e.width() + parseInt(e.css("margin-left")) + parseInt(e.css("margin-right")) + parseInt(e.css("padding-left")) + parseInt(e.css("padding-right"));
    w.find("ul").width(a * q);
    var c = Math.ceil(a * q / l);
    var d = {
        load0: 1
    };
    var m = parseInt(l / a);
    var g = w.find("img");
    function u() {
        if (!d["load" + k] && n === 1) {
            var y = k * m + 1;
            var p = (k + 1) * m;
            for (var x = 0; x < q; x++) {
                if (x + 1 >= y && x < p) {
                    g[x].src = g[x].getAttribute("_src")
                }
            }
            d["load" + k] = 1
        }
    }
    function v(x) {
        var p = parseInt($(x).attr("rel")) - 1;
        var i = k - p;
        if (i != 0) {
            if (w.find("ul").is(":animated")) {
                return
            }
            k = p;
            w.find("ul").animate({
                marginLeft: "+=" + i * l
            });
            r()
        }
    }
    function r() {
        if (k == 0) {
            t.find("span").addClass("on").attr("title", "下一页");
            s.find("span").removeClass("on").attr("title", "上一页")
        } else {
            if (k == c - 1) {
                s.find("span").addClass("on").attr("title", "上一页");
                t.find("span").removeClass("on").attr("title", "下一页")
            } else {
                s.find("span").addClass("on").attr("title", "上一页");
                t.find("span").addClass("on").attr("title", "下一页")
            }
        }
        if (b) {
            b.find("span.on").removeClass("on");
            b.find("span").eq(k).addClass("on")
        }
        u()
    }
    if (b) {
        var j = [];
        for (var o = 1; o <= c; o++) {
            j.push('<span title="��' + o + 'ҳ" rel="' + o + '"></span>')
        }
        b.html(j.join(""));
        b.find("span:first").addClass("on");
        if (h === "click") {
            b.find("span").click(function() {
                v(this)
            })
        } else {
            if (h === "mouseover") {
                b.find("span").mouseover(function() {
                    v(this)
                })
            }
        }
    }
    if (c > 1) {
        t.find("span").addClass("on").attr("title", "下一页");
        s.click(function() {
            if (w.find("ul").is(":animated") || !s.find("span").hasClass("on")) {
                return
            }
            k--;
            w.find("ul").animate({
                marginLeft: "+=" + l
            },
            function() {
                r()
            })
        });
        t.click(function() {
            if (w.find("ul").is(":animated") || !t.find("span").hasClass("on")) {
                return
            }
            k++;
            w.find("ul").animate({
                marginLeft: "-=" + l
            },
            function() {
                r()
            })
        })
    }
};